package cn.gdcp.videoplay;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class IndexActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_index);

        /*视频播放方式一：MediaController+VideoView*/
        findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(IndexActivity.this,
                        MainActivity.class);
                startActivity(intent);
            }
        });
        /*视频播放方式二：MediaPlayer+SurfaceView+自定义控制器 */
        findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(IndexActivity.this,
                        SurfaceViewActivity.class);
                startActivity(intent);
            }
        });
        /*视频播放方式三：MediaPlayer+SurfaceView+MediaController*/
        findViewById(R.id.btn3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(IndexActivity.this,
                        MediaControllerActivity.class);
                startActivity(intent);
            }
        });
    }
}
